﻿using Dal;
using IBll;
using Model;

namespace Bll
{
    public class UserBll:IUserBll
    {
        UserDal dal;
        public UserBll(UserDal dal)
        {
            this.dal = dal;
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="usrInfo">用户表</param>
        /// <returns>返回受影响行数</returns>
        public int AddUser(UsrInfo usrInfo)
        {
            try
            {
                return dal.AddUser(usrInfo);
            }
            catch(Exception e)
            {
                throw;
            }
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name">姓名</param>
        /// <param name="pwd">密码</param>
        /// <returns>返回受影响值</returns>
        public int Login(string name, string pwd)
        {
           try
            {
                return dal.Login(name, pwd);
            }
            catch (Exception e)
            {
                throw;
            }
        }
    }
}
